package edu.nf.vac.reservation.dao;

import edu.nf.vac.reservation.entity.Reservation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author : PYY
 * @create 2022/3/29
 */
public interface ReservationDao {
    /**
     * 查询所有的预约
     * @param reservation
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<Reservation> listReservation(@Param("reservation") Reservation reservation,
                                      @Param("pageNum") Integer pageNum,
                                      @Param("pageSize") Integer pageSize);

    /**
     * 添加预约
     */
    void addReservation(Reservation reservation);

    /**
     * 删除预约
     * @param reservationId
     */
    void delReservation(int reservationId);

    /**
     * 根据预约ID查询
     * @param reservationId
     * @return
     */
    Reservation queryById(int reservationId);

    /**
     * 根据用户id查询预约记录
     * @param uid
     * @return
     */
    List<Reservation> listReservationByUid(Integer uid);
}
